/********************************************************************
* ABOUT : This class is for doing various operations on Quaternions.
*
* AUTHOR : Dilawar Singh
*
* Written on : April 15, 2010
*
* Modified on : 
* 
* Dilawar Singh Pvt. Ltd. 2010
**********************************************************************/

#ifndef _IS_QUATERNION_R_H_
#define _IS_QUATERNION_R_H_

#include "stabilize_config.h"
#include "is_homography_matrix_R.h"
#include <iostream>

class IsQuaternionR : public IsMatrixR
{
public:
    kalmanType curQuaternion[QUAT_LENGTH];
    kalmanType prevQuaternion[QUAT_LENGTH];
    kalmanType myRotationMatrix[R_MATRIX_LENGTH];
  
public:
    // constructors
    IsQuaternionR(void);
    
    /* This function will calculate the normalised quaternion */
    void normalizeQuatR(kalmanType myQuaternion[QUAT_LENGTH]);
    
    /* This function will invert the quaternion */
    void invertQuaternion(kalmanType myQuaternion[QUAT_LENGTH]);
    
    /* This will calculate the rotation matrix for a single quaternion*/
    void quatToRotationMat(kalmanType *pMyQuaternion);

      /* This will calculate the hamiltonian product. */
    kalmanType* hamiltonionProduct(kalmanType *pCurQuaternion, 
        kalmanType *pPrevQuaternion);

public:
    virtual ~IsQuaternionR(void);
};
#endif
